package cn.idietrade.idietradegoodmanage8008.demo.service.impl;

import cn.idietrade.common.pojo.SecondGoods;
import cn.idietrade.idietradegoodmanage8008.demo.mapper.GoodsManageMapper;
import cn.idietrade.idietradegoodmanage8008.demo.service.GoodsManageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 作者：李永康
 * @createTime 2022/12/5 14:24
 * @description 描述
 */
@Service
public class GoodsManageServiceImpl implements GoodsManageService {
    @Resource
    private GoodsManageMapper goodsManageMapper;
    @Override
    public int goodsAudit(Integer state, Integer id) {
        return goodsManageMapper.goodsAudit(state,id);
    }

    @Override
    public PageInfo<SecondGoods> getList(String goodsName,Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<SecondGoods> list = goodsManageMapper.getList(goodsName);
        return new PageInfo<SecondGoods>(list);
    }
}
